﻿/// <reference path="RequestHandler.js" />
/// <reference path="../HttpRequest.js" />
/// <reference path="../../utilities/FXDom.js" />
/// <reference path="../../utilities/Markup.js" />
///--------------------------------------------------------------------
/// <file name="BanMemberHandler.js">
///   Adds markup buttons to the ban member page.
/// </file>
///--------------------------------------------------------------------

NAMFox.ns(function() { with (NAMFox) {

this.BanMemberHandler = function() {
};

BanMemberHandler.prototype = new RequestHandler();
BanMemberHandler.prototype.name = "BanMemberHandler";

BanMemberHandler.prototype.handleRequestCore = function(request, _$) {
    /// <summary>Handles a request.</summary>
    /// <param name="request" type="HttpRequest">
    ///   The HTTP request which encapsulates the
    ///   document and route data for this request.
    /// </param>

    var textArea = request.htmlDocument.__namfox__.textArea = _$("textarea[name=reason]");
    
    textArea.attr(
        "innerHTML", $.messages.getDefaultMessage().text
    ).after(
        '<div id="namfox-ban-member-markup"></div>'
    ).find(
        "#namfox-ban-member-markup"
    ).append(
        Markup.create(
            textArea,
            MarkupLocation.BanMember,
            Markup.customMessages
        )
    );
};

}});